<template>
    <h1>借款款项明细</h1>

    <table>
        <thead>
            <tr>
                <th>用户借款编号</th>
                <th>借款用户账号</th>
                <th>借款款项名称</th>
                <th>借款金额</th>
                <th>剩余还款金额</th>
            </tr>
        </thead>

        <tbody>
            <tr v-for="item in Info">
                <td>{{ item.UB_Id }}</td>
                <td>{{ item.UL_Name }}</td>
                <td>{{ item.BM_Name }}</td>
                <td>{{ item.UB_Money }}</td>
                <td></td>
            </tr>
        </tbody>

    </table>

</template>

<script setup lang="ts">
import { ref,onMounted } from 'vue';
import axios from 'axios';
import { useRoute } from 'vue-router';

const route = useRoute();

console.log(route.params.Id);

const Info = ref([{
    UB_Id:'',
    UL_Name:'',
    BM_Name:'',
    UB_Money:''
}])

onMounted( ()=>{
    axios({
        method:'get',
        url:'http://localhost:63517/api/Borrow/UserBorrowInfoAll',
        params:{
            Id:route.params.Id
        }
    })
    .then(res=>{
        console.log(res.data);
        Info.value = res.data;
    })
    .catch(err=>{
        console.log(err);
    })
})

</script>